<template>
  <div class="trade-view">
    <head-view
      @setLoading="setLoading"
      @setShopData="setShopData"
      @setGasStation="setGasStation"
      @setCatering="setCatering"
      @setService="setService"
    ></head-view>
    <div class="content">
      <shop-view
        v-loading="loadingObj.shop"
        :shopData="shopData"
        v-if="select == 0"
      ></shop-view>
      <gas-station :gasStation="gasStation" v-if="select == 1"></gas-station>
      <catering-view :catering="catering" v-if="select == 2"></catering-view>
      <service-view :service="service" v-if="select == 3"></service-view>
    </div>
    <div class="footer">
      <div class="fonter-item-box">
        <div
          class="footer-item"
          v-for="(item, index) in footerList"
          :key="index"
          :class="{ 'footer-item-select': select == index }"
          @click="setSelect(index)"
        >
          {{ item.name }}
        </div>
      </div>
    </div>
  </div>
</template>

<script>
// 头部
import HeadView from "@/components/HeadView/index2.vue";
// 商超部
import ShopView from "@/views/trade/childrens/shop.vue";
// 餐饮部
import CateringView from "@/views/trade/childrens/catering.vue";
// 加油站
import GasStation from "@/views/trade/childrens/gasStation.vue";
// 维修部
import ServiceView from "@/views/trade/childrens/service.vue";
export default {
  name: "TradeView",
  mixins: [],
  components: {
    HeadView,
    ShopView,
    CateringView,
    GasStation,
    ServiceView,
  },
  props: {},
  data() {
    return {
      loadingObj: {
        shop: false,
        catering: false,
        service: false,
        gasStation: false,
      },
      select: 0,
      footerList: [
        {
          name: "商超部",
          id: 1,
        },
        {
          name: "加油站",
          id: 2,
        },
        {
          name: "餐饮部",
          id: 3,
        },
        {
          name: "维修部",
          id: 4,
        },
      ],
      // 商超部数据
      shopData: {
        // 单品销量排行榜
        left1Data: [
          {
            day: null,
            storeName: null,
            num: null,
            money: 80200, //销售额
            moneyRate: 100,
            numRate: null,
            stock: null, //库存
            commodity: "黄鹤楼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 70336, //销售额
            moneyRate: 87.7,
            numRate: null,
            stock: null, //库存
            commodity: "七匹狼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 55548, //销售额
            moneyRate: 69.26,
            numRate: null,
            stock: null, //库存
            commodity: "康师傅红烧牛肉面-桶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 54592, //销售额
            moneyRate: 68.07,
            numRate: null,
            stock: null, //库存
            commodity: "娃哈哈矿泉水", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 53420, //销售额
            moneyRate: 66.61,
            numRate: null,
            stock: null, //库存
            commodity: "可口可乐", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 37414, //销售额
            moneyRate: 46.650000000000006,
            numRate: null,
            stock: null, //库存
            commodity: "人民大会堂香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 31016, //销售额
            moneyRate: 38.67,
            numRate: null,
            stock: null, //库存
            commodity: "益达口香糖", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11770, //销售额
            moneyRate: 14.680000000000001,
            numRate: null,
            stock: null, //库存
            commodity: "充电器", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11472, //销售额
            moneyRate: 14.299999999999999,
            numRate: null,
            stock: null, //库存
            commodity: "红牛", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 10696, //销售额
            moneyRate: 13.34,
            numRate: null,
            stock: null, //库存
            commodity: "冰红茶", //商品名称
          },
        ],
        // 单品销售额排行榜
        right1Data: [
          {
            day: null,
            storeName: null,
            num: null,
            money: 80200, //销售额
            moneyRate: 100,
            numRate: null,
            stock: null, //库存
            commodity: "黄鹤楼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 70336, //销售额
            moneyRate: 87.7,
            numRate: null,
            stock: null, //库存
            commodity: "七匹狼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 55548, //销售额
            moneyRate: 69.26,
            numRate: null,
            stock: null, //库存
            commodity: "康师傅红烧牛肉面-桶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 54592, //销售额
            moneyRate: 68.07,
            numRate: null,
            stock: null, //库存
            commodity: "娃哈哈矿泉水", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 53420, //销售额
            moneyRate: 66.61,
            numRate: null,
            stock: null, //库存
            commodity: "可口可乐", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 37414, //销售额
            moneyRate: 46.650000000000006,
            numRate: null,
            stock: null, //库存
            commodity: "人民大会堂香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 31016, //销售额
            moneyRate: 38.67,
            numRate: null,
            stock: null, //库存
            commodity: "益达口香糖", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11770, //销售额
            moneyRate: 14.680000000000001,
            numRate: null,
            stock: null, //库存
            commodity: "充电器", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11472, //销售额
            moneyRate: 14.299999999999999,
            numRate: null,
            stock: null, //库存
            commodity: "红牛", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 10696, //销售额
            moneyRate: 13.34,
            numRate: null,
            stock: null, //库存
            commodity: "冰红茶", //商品名称
          },
        ],
        // 销售额统计
        dataAll: [
          {
            day: "2024-04-20", //时间
            nowMoney: 83236, //当前销售额
            lastMoney: 79628, //同期销售额
            nowNum: 11743, //当前销售量
            lastNum: 10457, //同期销售量
          },
          {
            day: "2024-04-21", //时间
            nowMoney: 74569, //当前销售额
            lastMoney: 97565, //同期销售额
            nowNum: 10643, //当前销售量
            lastNum: 11856, //同期销售量
          },
          {
            day: "2024-04-22", //时间
            nowMoney: 86850, //当前销售额
            lastMoney: 81476, //同期销售额
            nowNum: 12212, //当前销售量
            lastNum: 9202, //同期销售量
          },
          {
            day: "2024-04-23", //时间
            nowMoney: 89517, //当前销售额
            lastMoney: 87146, //同期销售额
            nowNum: 10519, //当前销售量
            lastNum: 12107, //同期销售量
          },
          {
            day: "2024-04-24", //时间
            nowMoney: 85412, //当前销售额
            lastMoney: 87907, //同期销售额
            nowNum: 10531, //当前销售量
            lastNum: 11878, //同期销售量
          },
          {
            day: "2024-04-25", //时间
            nowMoney: 98885, //当前销售额
            lastMoney: 92567, //同期销售额
            nowNum: 13552, //当前销售量
            lastNum: 11484, //同期销售量
          },
        ],
        // 销售额对比
        topData: {
          nowMoney: 518469, //当前
          lastMoney: 526289, //同期
          rate: -1.49,
          name: "黄鹤楼香烟", //产品名称
          money: 80200, //产品金额
          moneyRate: 15.47, //占比
        },
        left2Data: [
          {
            day: null,
            storeName: null,
            num: 2975, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 90.23, //占比
            stockRateFact: 90.23, //实际占比
            stock: 8053, //库存
            expectNum: 8925, //预计销量=销售量当日*3
            commodity: "可口可乐", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 2769, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 123.75, //实际占比
            stock: 10280, //库存
            expectNum: 8307, //预计销量=销售量当日*3
            commodity: "娃哈哈矿泉水", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 977, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 137.56, //实际占比
            stock: 4032, //库存
            expectNum: 2931, //预计销量=销售量当日*3
            commodity: "康师傅红烧牛肉面-桶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 522, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 31.99, //占比
            stockRateFact: 31.99, //实际占比
            stock: 501, //库存
            expectNum: 1566, //预计销量=销售量当日*3
            commodity: "黄鹤楼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 868, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 66.17, //占比
            stockRateFact: 66.17, //实际占比
            stock: 1723, //库存
            expectNum: 2604, //预计销量=销售量当日*3
            commodity: "益达口香糖", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 972, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 16.56, //占比
            stockRateFact: 16.56, //实际占比
            stock: 483, //库存
            expectNum: 2916, //预计销量=销售量当日*3
            commodity: "七匹狼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 486, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 104.25, //实际占比
            stock: 1520, //库存
            expectNum: 1458, //预计销量=销售量当日*3
            commodity: "金锣火腿肠", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 428, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 619.55, //实际占比
            stock: 7955, //库存
            expectNum: 1284, //预计销量=销售量当日*3
            commodity: "冰红茶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 727, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 642.14, //实际占比
            stock: 14005, //库存
            expectNum: 2181, //预计销量=销售量当日*3
            commodity: "清风面巾纸", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: 918, //销售量当日
            money: null,
            moneyRate: null,
            numRate: null,
            stockRate: 100, //占比
            stockRateFact: 359.11, //实际占比
            stock: 9890, //库存
            expectNum: 2754, //预计销量=销售量当日*3
            commodity: "农夫山泉矿泉水", //商品名称
          },
        ],
      },
      // 加油站
      gasStation: {
        // 入站车辆类型
        leftData: {
          allNum: 1955,
          list: [
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "小客车", //车辆类型
              carNum: 688, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "大客车", //车辆类型
              carNum: 290, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "大货车", //车辆类型
              carNum: 419, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "小货车", //车辆类型
              carNum: 533, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "危化货车", //车辆类型
              carNum: 22, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "牲畜车", //车辆类型
              carNum: 3, //数量
              stayTime: 0,
            },
          ],
        },
        // 收入来源
        rightData: {
          list: [
            {
              name: "0#",
              money: 1128246.45,
              rate: 30.02,
            },
            {
              name: "92#",
              money: 401915.56,
              rate: 10.69,
            },
            {
              name: "95#",
              money: 586294.01,
              rate: 15.6,
            },
            {
              name: "98#",
              money: 179184.46,
              rate: 4.77,
            },
            {
              name: "非油品",
              money: 1463005.42,
              rate: 38.92,
            },
          ],
          allMoney: 3758645.9,
        },
        // 销售趋势
        leftBottomData: [
          {
            day: "2024-04-20", //时间
            nowMoney: 392694.25, //当前
            nowOtherMoney: 271503.18,
            lastMoney: 421823.15, //同期
            lastOtherMoney: 299732.91,
          },
          {
            day: "2024-04-21", //时间
            nowMoney: 309126.18, //当前
            nowOtherMoney: 244049.25,
            lastMoney: 463353.91, //同期
            lastOtherMoney: 151339.12,
          },
          {
            day: "2024-04-22", //时间
            nowMoney: 477875.51, //当前
            nowOtherMoney: 208360.36,
            lastMoney: 391090.24, //同期
            lastOtherMoney: 286071.55,
          },
          {
            day: "2024-04-23", //时间
            nowMoney: 441691.27, //当前
            nowOtherMoney: 280509.16,
            lastMoney: 515127.1, //同期
            lastOtherMoney: 270792.71,
          },
          {
            day: "2024-04-24", //时间
            nowMoney: 329764.54, //当前
            nowOtherMoney: 276716.17,
            lastMoney: 497989.65, //同期
            lastOtherMoney: 243169.89,
          },
          {
            day: "2024-04-25", //时间
            nowMoney: 344488.73, //当前
            nowOtherMoney: 181867.3,
            lastMoney: 507280.29, //同期
            lastOtherMoney: 202446.21,
          },
        ],
        // 销售统计
        rightBottomData: [
          {
            day: "2024-04-20", //时间
            nowOilMoney: 187427.1, //柴油金额
            nowOilNum: 20.86, //柴油数量吨
            nowGasMoney: 205267.15, //汽油金额
            nowGasNum: 17.14, //汽油数量吨
            nowOtherMoney: 271503.18, //非油品金额
            lastOilMoney: 202881.3, //同期柴油金额
            lastOilNum: 22.58, //同期柴油数量
            lastGasMoney: 218941.85, //同期汽油金额
            lastGasNum: 18.87, //同期汽油数量
            lastOtherMoney: 299732.91, //同期非油品金额
          },
          {
            day: "2024-04-21", //时间
            nowOilMoney: 109706.85, //柴油金额
            nowOilNum: 12.21, //柴油数量吨
            nowGasMoney: 199419.33, //汽油金额
            nowGasNum: 17.31, //汽油数量吨
            nowOtherMoney: 244049.25, //非油品金额
            lastOilMoney: 265596.6, //同期柴油金额
            lastOilNum: 29.56, //同期柴油数量
            lastGasMoney: 197757.31, //同期汽油金额
            lastGasNum: 16.84, //同期汽油数量
            lastOtherMoney: 151339.12, //同期非油品金额
          },
          {
            day: "2024-04-22", //时间
            nowOilMoney: 229207.35, //柴油金额
            nowOilNum: 25.51, //柴油数量吨
            nowGasMoney: 248668.16, //汽油金额
            nowGasNum: 21.09, //汽油数量吨
            nowOtherMoney: 208360.36, //非油品金额
            lastOilMoney: 125071.2, //同期柴油金额
            lastOilNum: 13.92, //同期柴油数量
            lastGasMoney: 266019.04, //同期汽油金额
            lastGasNum: 22.41, //同期汽油数量
            lastOtherMoney: 286071.55, //同期非油品金额
          },
          {
            day: "2024-04-23", //时间
            nowOilMoney: 241067.55, //柴油金额
            nowOilNum: 26.83, //柴油数量吨
            nowGasMoney: 200623.72, //汽油金额
            nowGasNum: 16.7, //汽油数量吨
            nowOtherMoney: 280509.16, //非油品金额
            lastOilMoney: 267213.9, //同期柴油金额
            lastOilNum: 29.74, //同期柴油数量
            lastGasMoney: 247913.2, //同期汽油金额
            lastGasNum: 21.19, //同期汽油数量
            lastOtherMoney: 270792.71, //同期非油品金额
          },
          {
            day: "2024-04-24", //时间
            nowOilMoney: 178172.55, //柴油金额
            nowOilNum: 19.83, //柴油数量吨
            nowGasMoney: 151591.99, //汽油金额
            nowGasNum: 12.91, //汽油数量吨
            nowOtherMoney: 276716.17, //非油品金额
            lastOilMoney: 167839.8, //同期柴油金额
            lastOilNum: 18.68, //同期柴油数量
            lastGasMoney: 330149.85, //同期汽油金额
            lastGasNum: 28.23, //同期汽油数量
            lastOtherMoney: 243169.89, //同期非油品金额
          },
          {
            day: "2024-04-25", //时间
            nowOilMoney: 182665.05, //柴油金额
            nowOilNum: 20.33, //柴油数量吨
            nowGasMoney: 161823.68, //汽油金额
            nowGasNum: 14.36, //汽油数量吨
            nowOtherMoney: 181867.3, //非油品金额
            lastOilMoney: 225164.1, //同期柴油金额
            lastOilNum: 25.06, //同期柴油数量
            lastGasMoney: 282116.19, //同期汽油金额
            lastGasNum: 24.52, //同期汽油数量
            lastOtherMoney: 202446.21, //同期非油品金额
          },
        ],
        // 销售额对比
        topData: {
          nowMoney: 3758645.9, //当前
          lastMoney: 4250216.73, //同期
          rate: -11.57, //增长
          name: "非油品", //产品名称
          money: 1463005.42, //产品价格
          moneyRate: 38.92, //产品占比
        },
      },
      // 餐饮部数据
      catering: {
        // 食品销售额排行榜
        left1Data: [
          {
            day: null,
            storeName: null,
            num: null,
            money: 80200, //销售额
            moneyRate: 100,
            numRate: null,
            stock: null, //库存
            commodity: "黄鹤楼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 70336, //销售额
            moneyRate: 87.7,
            numRate: null,
            stock: null, //库存
            commodity: "七匹狼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 55548, //销售额
            moneyRate: 69.26,
            numRate: null,
            stock: null, //库存
            commodity: "康师傅红烧牛肉面-桶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 54592, //销售额
            moneyRate: 68.07,
            numRate: null,
            stock: null, //库存
            commodity: "娃哈哈矿泉水", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 53420, //销售额
            moneyRate: 66.61,
            numRate: null,
            stock: null, //库存
            commodity: "可口可乐", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 37414, //销售额
            moneyRate: 46.650000000000006,
            numRate: null,
            stock: null, //库存
            commodity: "人民大会堂香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 31016, //销售额
            moneyRate: 38.67,
            numRate: null,
            stock: null, //库存
            commodity: "益达口香糖", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11770, //销售额
            moneyRate: 14.680000000000001,
            numRate: null,
            stock: null, //库存
            commodity: "充电器", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11472, //销售额
            moneyRate: 14.299999999999999,
            numRate: null,
            stock: null, //库存
            commodity: "红牛", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 10696, //销售额
            moneyRate: 13.34,
            numRate: null,
            stock: null, //库存
            commodity: "冰红茶", //商品名称
          },
        ],
        right1Data: [
          {
            day: null,
            storeName: null,
            num: null,
            money: 80200, //销售额
            moneyRate: 100,
            numRate: null,
            stock: null, //库存
            commodity: "黄鹤楼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 70336, //销售额
            moneyRate: 87.7,
            numRate: null,
            stock: null, //库存
            commodity: "七匹狼香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 55548, //销售额
            moneyRate: 69.26,
            numRate: null,
            stock: null, //库存
            commodity: "康师傅红烧牛肉面-桶", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 54592, //销售额
            moneyRate: 68.07,
            numRate: null,
            stock: null, //库存
            commodity: "娃哈哈矿泉水", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 53420, //销售额
            moneyRate: 66.61,
            numRate: null,
            stock: null, //库存
            commodity: "可口可乐", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 37414, //销售额
            moneyRate: 46.650000000000006,
            numRate: null,
            stock: null, //库存
            commodity: "人民大会堂香烟", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 31016, //销售额
            moneyRate: 38.67,
            numRate: null,
            stock: null, //库存
            commodity: "益达口香糖", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11770, //销售额
            moneyRate: 14.680000000000001,
            numRate: null,
            stock: null, //库存
            commodity: "充电器", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 11472, //销售额
            moneyRate: 14.299999999999999,
            numRate: null,
            stock: null, //库存
            commodity: "红牛", //商品名称
          },
          {
            day: null,
            storeName: null,
            num: null,
            money: 10696, //销售额
            moneyRate: 13.34,
            numRate: null,
            stock: null, //库存
            commodity: "冰红茶", //商品名称
          },
        ],
        dataAll: [
          {
            day: "2024-04-20", //时间
            nowMoney: 83236, //当前销售额
            lastMoney: 79628, //同期销售额
            nowNum: 11743, //当前销售量
            lastNum: 10457, //同期销售量
          },
          {
            day: "2024-04-21", //时间
            nowMoney: 74569, //当前销售额
            lastMoney: 97565, //同期销售额
            nowNum: 10643, //当前销售量
            lastNum: 11856, //同期销售量
          },
          {
            day: "2024-04-22", //时间
            nowMoney: 86850, //当前销售额
            lastMoney: 81476, //同期销售额
            nowNum: 12212, //当前销售量
            lastNum: 9202, //同期销售量
          },
          {
            day: "2024-04-23", //时间
            nowMoney: 89517, //当前销售额
            lastMoney: 87146, //同期销售额
            nowNum: 10519, //当前销售量
            lastNum: 12107, //同期销售量
          },
          {
            day: "2024-04-24", //时间
            nowMoney: 85412, //当前销售额
            lastMoney: 87907, //同期销售额
            nowNum: 10531, //当前销售量
            lastNum: 11878, //同期销售量
          },
          {
            day: "2024-04-25", //时间
            nowMoney: 98885, //当前销售额
            lastMoney: 92567, //同期销售额
            nowNum: 13552, //当前销售量
            lastNum: 11484, //同期销售量
          },
        ],
        topData: {
          nowMoney: 518469, //当前
          lastMoney: 526289, //同期
          rate: -1.49,
          name: "黄鹤楼香烟", //产品名称
          money: 80200, //产品金额
          moneyRate: 15.47, //占比
        },
      },
      // 维修部数据
      service: {
        // 入站车辆类型
        leftData: {
          allNum: 1431,
          list: [
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "小客车", //车辆类型
              carNum: 344, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "大客车", //车辆类型
              carNum: 8, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "大货车", //车辆类型
              carNum: 398, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "小货车", //车辆类型
              carNum: 567, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "危化货车", //车辆类型
              carNum: 109, //数量
              stayTime: 0,
            },
            {
              id: 0,
              saId: 0,
              saName: null,
              day: null,
              carType: 0,
              carTypeName: "牲畜车", //车辆类型
              carNum: 5, //数量
              stayTime: 0,
            },
          ],
        },
        // 配件库存统计
        rightData: {
          partsNum: 44,
          vulnerablePartsNum: 1865,
          partsList: [
            {
              id: 6,
              partsName: "火花塞", //配件名称
              partsNum: 11, //数量
              partsMoney: 600, //单价
            },
            {
              id: 7,
              partsName: "喷油嘴", //配件名称
              partsNum: 14, //数量
              partsMoney: 570, //单价
            },
            {
              id: 8,
              partsName: "传动带", //配件名称
              partsNum: 19, //数量
              partsMoney: 360, //单价
            },
          ],
          vulnerablePartsList: [
            {
              id: 1,
              partsName: "轮胎", //易损件名称
              partsNum: 124, //易损件数量
              partsMoney: 900, //易损件单价
            },
            {
              id: 2,
              partsName: "机油", //易损件名称
              partsNum: 517, //易损件数量
              partsMoney: 120, //易损件单价
            },
            {
              id: 3,
              partsName: "刹车片", //易损件名称
              partsNum: 189, //易损件数量
              partsMoney: 210, //易损件单价
            },
            {
              id: 4,
              partsName: "防冻液", //易损件名称
              partsNum: 546, //易损件数量
              partsMoney: 110, //易损件单价
            },
            {
              id: 5,
              partsName: "刹车油", //易损件名称
              partsNum: 489, //易损件数量
              partsMoney: 145, //易损件单价
            },
          ],
        },
        // 销售额统计
        dataAll: [
          {
            day: "2024-04-20", //时间
            nowMoney: 12575, //当前
            lastMoney: 11635, //同期
            nowNum: 46, //当前销售量
            lastNum: 57, //同期销售量
          },
          {
            day: "2024-04-21", //时间
            nowMoney: 9185, //当前
            lastMoney: 6070, //同期
            nowNum: 52, //当前销售量
            lastNum: 49, //同期销售量
          },
          {
            day: "2024-04-22", //时间
            nowMoney: 8935, //当前
            lastMoney: 12395, //同期
            nowNum: 46, //当前销售量
            lastNum: 42, //同期销售量
          },
          {
            day: "2024-04-23", //时间
            nowMoney: 10255, //当前
            lastMoney: 8325, //同期
            nowNum: 46, //当前销售量
            lastNum: 35, //同期销售量
          },
          {
            day: "2024-04-24", //时间
            nowMoney: 10905, //当前
            lastMoney: 9245, //同期
            nowNum: 64, //当前销售量
            lastNum: 50, //同期销售量
          },
          {
            day: "2024-04-25", //时间
            nowMoney: 15460, //当前
            lastMoney: 10765, //同期
            nowNum: 65, //当前销售量
            lastNum: 34, //同期销售量
          },
        ],
        // 销售额对比
        topData: {
          nowMoney: 67315, //当前
          lastMoney: 58435, //同期
          rate: 15.2, //增长
          name: "易损件", //产品名称
          money: 57985, //产品金额
          moneyRate: 86.14, //产品占比
        },
      },
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    document.title = "业态分析";
  },
  methods: {
    setLoading(obj) {
      this.loadingObj = {
        ...obj,
      };
    },
    setSelect(index) {
      // console.info("setSelect === ",index)
      this.select = index;
    },
    // 给商超部传值
    setShopData(obj) {
      switch (obj.type) {
        case "单品销售额排行榜":
          this.shopData.right1Data = obj.data || [];
          break;
        case "单品销量排行榜":
          this.shopData.left1Data = obj.data || [];
          break;
        case "销售额统计":
          this.shopData.dataAll = obj.data || [];
        case "销售额对比":
          this.shopData.topData = obj.data || {
            nowMoney: 0,
            lastMoney: 0,
            rate: 0,
            name: "", //产品名称
            money: 0, //产品金额
            moneyRate: 0, //占比
          };
          break;
        case "库存":
          this.shopData.left2Data = obj.data || {};
          break;
        default:
          break;
      }
    },
    // 给加油站传值
    setGasStation(obj) {
      switch (obj.type) {
        case "入站车辆类型":
          this.gasStation.leftData = obj.data || {
            allNum: 0,
            list: [],
          };
          break;
        case "各类销售":
          this.gasStation.rightBottomData = obj.data || {
            allNum: 0,
            list: [],
          };
          break;
        case "销售额对比":
          this.gasStation.topData = obj.data || {
            nowMoney: 0,
            lastMoney: 0,
            rate: 0,
            name: "", //产品名称
            money: 0, //产品金额
            moneyRate: 0, //占比
          };
          break;
        case "收入来源":
          this.gasStation.rightData = obj.data || {
            list: [],
            allMoney: 0,
          };
          break;
        case "销售趋势":
          this.gasStation.leftBottomData = obj.data || [];
          break;
        default:
          break;
      }
    },
    // 给餐饮部传值
    setCatering(obj) {
      switch (obj.type) {
        case "食品销售额排行榜":
          this.catering.left1Data = obj.data || [];
          break;
        case "餐厅销售额排行榜":
          this.catering.right1Data = obj.data || [];
          break;
        case "销售额统计":
          this.catering.dataAll = obj.data || [];
          break;
        case "销售额对比":
          this.catering.topData = obj.data || {
            nowMoney: 0,
            lastMoney: 0,
            rate: 0,
            name: "", //产品名称
            money: 0, //产品金额
            moneyRate: 0, //占比
          };
          break;
        default:
          break;
      }
    },
    // 给维修部传值
    setService(obj) {
      switch (obj.type) {
        case "入站车辆类型":
          this.service.leftData = obj.data || {
            allNum: 0,
            list: [],
          };
          break;
        case "配件库存统计":
          this.service.rightData = obj.data || {
            partsNum: 0,
            vulnerablePartsNum: 0,
            partsList: [],
            vulnerablePartsList: [],
          };
          break;
        case "销售额统计":
          this.service.dataAll = obj.data || [];
          break;
        case "销售额对比":
          this.service.topData = obj.data || {
            nowMoney: 0,
            lastMoney: 0,
            rate: 0,
            name: "", //产品名称
            money: 0, //产品金额
            moneyRate: 0, //占比
          };
          break;
        default:
          break;
      }
    },
  },
};
</script>
<style lang="scss" scoped>
.trade-view {
  //background: rgba(255,255,255,0.8);
  background-image: url("../../assets/img/ytfx/bg.png");
  /* 使背景图片铺满整个元素 */
  background-size: cover;
  .content {
    height: calc(100vh - 215px);
    width: 100%;
  }
  .footer {
    height: 101px;
    width: 100%;
    display: flex;
    justify-content: center;
    position: relative;
    .fonter-item-box {
      width: 1313px;
      height: 101px;
      position: fixed;
      bottom: 0;
      left: calc((100% - 1313px) / 2);
      background-image: url("../../assets/img/ytfx/footer.png");
      background-size: cover; /* 图片覆盖整个元素，保持图片的宽高比 */
      background-repeat: no-repeat; /* 不重复图片 */
      align-items: center;
      display: flex;
      justify-content: center;
      .footer-item {
        width: 110px;
        height: 35px;
        line-height: 35px;
        margin-left: 40px;
        margin-top: 30px;
        font-size: 12px;
        text-align: center;
        color: rgba(255, 255, 255, 0.7);
        background-image: url("../../assets/img/ytfx/footern.png");
        background-size: cover; /* 图片覆盖整个元素，保持图片的宽高比 */
        background-repeat: no-repeat; /* 不重复图片 */
        //background: #000;
      }
      .footer-item-select {
        background-image: url("../../assets/img/ytfx/footery1.png");
        background-size: cover; /* 图片覆盖整个元素，保持图片的宽高比 */
        background-repeat: no-repeat; /* 不重复图片 */
        font-size: 16px;
        color: #fff;
        font-weight: bold;
      }
    }
  }
}
</style>
<style lang="scss">
.el-popover {
  background: rgba(0, 0, 0, 0.8) !important;
  color: #fff !important;
  border: none !important;
}
</style>
